package cn.sf.sufingvideoconsumer.service;

import cn.sf.pojo.Video;
import cn.sf.pojo.VideoClassify;
import cn.sf.sufingvideoconsumer.fallback.IndexServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author sric
 */
@FeignClient(name = "SUFING-VIDEO-PROVIDER", fallback = IndexServiceFallback.class)
public interface IndexService {
    /**
     * 随机查询几条视频信息
     *
     * @return
     */
    @RequestMapping("/queryRandom")
    String queryRandom();

    @RequestMapping("/getRedisQueryRandom")
    String getRedisQueryRandom();


    @RequestMapping("/queryVideoClassify")
    List<VideoClassify> queryVideoClassify();

    /**
     *
     * 用来查询点击分类后的信息
     *
     * @param primary
     * @param classification
     * @param sort
     * @return
     */
    @RequestMapping("/classificationQueryVideo")
    List<Video> classificationQueryVideo(@RequestParam("primary") Long primary,@RequestParam("classification")Long classification,@RequestParam("sort") Integer sort);
}
